<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- import Vue before Element -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
</head>
<body>
<div id="app">
        描述: <input v-model="subject" value=""/><br>
        金额: <input v-model="money" value=""/><br>
        <button  @click="submitItem">结算</button>
</div>

<!--导入axios-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.js"></script>

<script>
    new Vue({
        el: "#app",
        methods: {
            submitItem(){
                axios.get('http://192.168.0.109:8085/pays/topay?subject='+this.subject+'&money='+this.money).then(res=>{
                    let divForm = document.getElementsByTagName('divform')
                    if (divForm.length) {
                        document.body.removeChild(divForm[0])
                    }
                    const div=document.createElement('divform');
                    div.innerHTML=res.data;
                    document.body.appendChild(div);
                    document.forms[0].setAttribute('target', '_blank')
                    document.forms[0].submit();
                })
            }
        },
        data() {
            return {
                subject:'',
                money:'',
            }
        }
    })
</script>
</body>
</html>